package com.poitest.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;


/**
 * @标题 TestController
 * @作者 Mr.chen
 * @创建日期 2019/1/10 14:02
 * @版本号 1.0
 **/
@Controller
public class TestController {
    @Autowired
    RedisTemplate<Object, Object> redisTemplate;

    @RequestMapping("index")
    public String index(){
        User user = new User();
        user.setName("小明");
        user.setAge(22);
        redisTemplate.boundValueOps("xiaoming2").set(user);
        return "index";
    }
    @RequestMapping("toupiao")
    public String toupiao(){
        return "toupiao";
    }


    @RequestMapping("add")
    public String save(){
        return "add";
    }
}
